import store from "../store";

export default function Hello() {
  // 1. 获取 store 中的 state
  const state = store.getState();

  const handleClick = () => {
    // 派发动作
    store.dispatch({
      // 动作对象
      type: "INCREMENT",
    });
  };

  return (
    <div>
      <h4>Hello</h4>

      <button onClick={handleClick}>COUNT: {state.count}</button>
    </div>
  );
}
